<?php

// Acceso restringido
defined('JL') or die('Acceso restringido');

class SectionModel extends JLModelBase {

    /**
     * Funcion que retorn Sections
     * @Retorna bool
     */
    public function getSections() {
        $_true = null;

        $sql = "SELECT 
			  `int_id_section`,
			  `var_desc_section`
			FROM 
			  `tbl_sections`
            WHERE int_id_section != 27";

        $this->DB->executeQuery($sql);

        if ($this->DB->getRowsAffected() > 0) {
            $_true = $this->DB->getDataArray();
        }

        return $_true;
    }

    /**
     * Funcion que retorn Sections
     * @Retorna bool
     */
    public function getSectionByID($id) {
        $_true = null;

        $sql = "SELECT 
			  `int_id_section`,
			  `var_desc_section`
			FROM 
			  `tbl_sections`
            WHERE `int_id_section` = " . $this->DB->Quote($id);

        $this->DB->executeQuery($sql);

        if ($this->DB->getRowsAffected() > 0) {
            $_true = $this->DB->getDataArray();
            $_true = $_true[0];
        }

        return $_true;
    }

}